#ifndef __ISO_ME_H
#define __ISO_ME_H

#define L_OUT 0//PIN_H4
#define K_OUT 0//PIN_F0
#define K_LOW 	0//(output_high(K_OUT))
#define K_HIGH 	0//(output_low(K_OUT))
#define L_LOW	0//(output_high(L_OUT))
#define L_HIGH	0//(output_low(L_OUT))
#define K_IN  	0//(bit_test(CMCON,7))		//(VPW_IN)

#define ISO_W0_MIN 	2 //2ms
#define ISO_W1_MAX	((UWORD)300) //ms
#define ISO_W2_MAX	20 //ms
#define ISO_W4_MIN	25 //ms
#define ISO_W4_MAX	50 //ms

#define ISO_P3_MIN	55 //ms
#define ISO_P3_MAX	((WORD)3000) //ms
#define ISO_P4_MIN	5 //ms

#define ISO_P2_MAX  50 //ms  changed to 100 for testing
#define ISO_TINIL	25 //ms
#define ISO_TWUP	50 //ms

#define ISO_10400_BAUD 120

#define ISO_DISCONNECT            0x00
#define ISO_9141_5BAUD_CONNECT    0x01
#define KWP_SLOW_CONNECT          0x02
#define KWP_FAST_CONNECT          0x03


#define ISO_BUS_ERROR           0x01
#define ISO_TIMEOUT             0x02
#define ISO_RECEIVED            0x03
#define ISO_SEND                0x04


BYTE iso_send(BYTE index);
BYTE check_iso();
BYTE iso_5baud();
BYTE kwp_fast();
void iso_5baud_putc(BYTE data);
BYTE iso_put(BYTE *data, BYTE len);
BYTE iso_get(BYTE *data, BYTE len);
BYTE checksum(BYTE *data, BYTE len);


#endif
